package com.example.config;



import com.example.entity.DailyExpense;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

@Repository
public interface DailyExpenseEsRepository extends ElasticsearchRepository<DailyExpense, Long> {

    // 按费用类型查询
    List<DailyExpense> findByType(String type);

    // 按部门+日期范围查询
    List<DailyExpense> findByDepartmentAndExpenseDateBetween(
            String department, LocalDate start, LocalDate end);

    // 按金额范围查询（大于min，小于max）
    List<DailyExpense> findByAmountBetween(BigDecimal min, BigDecimal max);
}
